<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" href="favicon.ico" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Vite App</title>
    <!-- 不直接加载 main.js -->
    <link rel="stylesheet" crossorigin href="assets/main-Bj6ZsPlc.css" />
  </head>
  <body>
    <div id="app"></div>
    <script>
      // 等待 window.aa1 有值
      function waitForAA1(resolve, reject, timeout = 10000, interval = 100) {
        const start = Date.now();
        const timer = setInterval(() => {
          if (window.aa1 !== undefined && window.aa1 !== null) {
            clearInterval(timer);
            resolve();
          } else if (Date.now() - start > timeout) {
            clearInterval(timer);
            reject(new Error("Timeout waiting for window.aa1"));
          }
        }, interval);
      }

      new Promise(waitForAA1)
        .then(() => {
          const script = document.createElement("script");
          script.type = "module";
          script.crossOrigin = "anonymous";
          script.src = "assets/main-DWiHPuhY.js";
          document.body.appendChild(script);
        })
        .catch((err) => {
          console.error("App launch aborted:", err);
        });
    </script>
  </body>
</html>
